home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
ddj0897.zip
/
CCDBMS.ZIP
/
THREAD.H
< prev
Wrap
C/C++ Source or Header
|
1997-03-18
|
1KB
|
50 lines
// =================================================================
// Thread.h
// =================================================================
// Harold Kasperink / John Dekker
// Dr. Dobb's Journal 1997
// =================================================================
// Thread class
// =================================================================
#ifndef _THREAD_H_
#define _THREAD_H_
// Fake thread library
typedef int pthread_t;
#ifdef _WIN32
#include <afxwin.h>
#include <winbase.h>
#endif
#ifndef boolean
#define boolean BOOL
#endif
#define FALSE 0
#define TRUE 1
class CThread;
void ThreadFunc(CThread *);
////////////////////////////////////////////////////////////////////
// CNutex
////////////////////////////////////////////////////////////////////
class CThread
{
public:
CThread();
virtual ~CThread();
void Create();
void Cancel();
void Detach();
void Join();
friend void ThreadFunc(CThread *);
virtual void Process(void) = 0;
private:
pthread_t m_Thread;
};
#endif